<template>
	<view class="guidance-detail">
		<view class="guidance-detail-header">
			<u-section title="就诊建议" :right="false" :bold='false' :line-color='themeColorLight' color="#000000"></u-section>
			<view class="guidance-detail-header-content">
				{{suggest||''}}
			</view>
		</view>
		<view class="div-cut"></view>
		<view class="guidance-detail-main">
			<view style="margin-bottom: 20rpx;">
				<u-section title="推荐科室" :right="false" :bold='false' :line-color='themeColorLight' color="#000000"></u-section>
			</view>
			<view v-for="(item,index) in dataList" :key="index" class="u-border-bottom guidance-detail-main-item flexR">
				<text>{{item.name||''}}</text>
				<view class="guidance-detail-main-item-btn" @click="toPage(item)">
					挂号
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { themeColorLight } from '@/static/js/theme.js'
	export default {
		data() {
			return {
				themeColorLight,
				suggest:'',
				dataList:[]
			}
		},
		onLoad(op) {
			if(op.data){
				let res = JSON.parse(op.data)
				this.dataList = res.departList||[]
				this.suggest = res.medicalAdvice||''
			}
		},
		methods:{
			toPage(item){
				uni.navigateTo({
					url:'/pages/registerPblist/index?deptCode=' + item.code||''
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.guidance-detail{
		height: calc(100vh);
		overflow: scroll;
		background-color: $uni-bg-color;
		&-header{
			padding: 30rpx;
			&-content{
				margin-top: 40rpx;
				color: $text-color-grey;
				text-indent:2em;
			}
		}
		&-main{
			padding: 30rpx;
			&-item{
				padding: 30rpx 0;
				justify-content: space-between;
				align-items: center;
				&-btn{
					border: 1px solid $border-color;
					border-radius: 6rpx;
					padding: 5px 20px;
					font-size: 22rpx;
					color: $theme-color-light;
				}
			}
		}
	}
</style>
